<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
	<script src="/admin/public/html5shiv.min.js"></script>
	<script src="/admin/public/respond.min.js"></script>
<![endif]-->
<!-- Bootstrap core CSS -->
    	<link href="/admin/newTemplate/css/bootstrap.min.css" rel="stylesheet"/>
    	<!-- <link href="../newTemplate/css/animate.css" rel="stylesheet"/>页面滑动 -->	
	    <link href="/admin/newTemplate/css/inspinia.css" rel="stylesheet"/>
	    <link rel="stylesheet" type="text/css" href="/admin/css/xcConfirm.css"/>
	    <style>
	    	.icheckbox_square-green{
	    		float:left;
	    	}
	    	.form-horizontal input,.form-horizontal select{
	    		margin-left:0;
	    	}
	    	
	    	#wrapper {
			    width: 100%;
			    height: 100%;
			}
	    </style>
<title>信息管理系统</title>
</head>
<body>
	<div id="wrapper" class="container">
		<div class="wrapper wrapper-content animated fadeInRight">
            <h3><strong>微信基本信息配置</strong></h3>
<div class="right_box">
    <div style="border:none;box-shadow:none;" class="right_one row">
        <div class="col-md-12 col-sm-12 col-xs-12" style="float:left;">
            <div class="form-horizontal">
                <div class="tabs-container">
                    <div class="tab-content panel-body">
                   	 <form class="form-horizontal" id="dataform" novalidate="novalidate">
						 <div class="form-group">
		                        <label class="col-lg-2 control-label">公众号APPID：</label>
		                        <div class="col-lg-6">
		                            <input type="text" class="form-control" data-val="true" data-val-required="请输入AppID" id="mach_appId" name="mach_appId" value="${mach_appId }">
		                            <span class="text-danger field-validation-valid" data-valmsg-for="mach_appId" data-valmsg-replace="true">
		                        </span></div>
		                    </div>
						<div class="form-group">
				                        <label class="col-lg-2 control-label">应用密钥：</label>
				                        <div class="col-lg-6">
				                            <input type="text" class="form-control" data-val="true" data-val-required="请输入AppSecret" id="appSecret" name="appSecret" value="${appSecret }">
				                            <span class="text-danger field-validation-valid" data-valmsg-for="AppSecret" data-valmsg-replace="true">
				                        </span></div>
				                    </div>
				                    <div class="form-group">
				                        <label class="col-lg-2 control-label">商户号：</label>
				                        <div class="col-lg-6">
				                            <input type="text" class="form-control" data-val="true" data-val-url="请输入微信支付分配的商户号" id="mchId" name="mchId" value="${ mchId}">
				                            <span class="text-danger field-validation-valid" data-valmsg-for="mchId" data-valmsg-replace="true">
				                        </span></div>
				                    </div>
				                 <%--    <div class="form-group">
				                        <label class="col-lg-2 control-label">设备号：</label>
				                        <div class="col-lg-6">
				                            <input type="text" class="form-control" data-val-url="请输入微信支付分配的设备号"  id="device_info" name="device_info" value="${device_info }">
				                            <span class="text-danger field-validation-valid" data-valmsg-for="device_info" data-valmsg-replace="true">
				                        </span></div>
				                    </div> --%>
				
				                  <%--   <div class="form-group">
				                        <label class="col-lg-2 control-label">用户openid：</label>
				                        <div class="col-lg-6">
				                            <textarea class="form-control" rows="3" id="openid" name="openid" >${openid }</textarea>
				                            <span class="text-danger field-validation-valid" data-valmsg-for="openid" data-valmsg-replace="true">
				                        </span></div>
				                    </div> --%>
				
						<div class="form-group">
							<label class="col-lg-2 control-label"></label>
							<div class="col-lg-6"> 
								<div class="sk-spinner sk-spinner-double-bounce"
									style="margin: inherit; display: none" id="loading">
									<div class="sk-double-bounce1"></div>
									<div class="sk-double-bounce2"></div>
								</div>
								<button type="button" onclick="btn();" class="btn btn-success"
									style="width: 93px; height: 40px; text-align: center; background-color: #1a7bb9">保存</button>
									<button  type="button" onclick="creatMenu()" class="btn btn-success"
									style="width: 120px; height: 40px; text-align: center; background-color: #1a7bb9;display: none;">生成公众号菜单</button>
							</div>
						</div>
					</form>
                   </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <input type="hidden" id="Content" name="Content"/>
         </div>
        </div>
    </div>
</div>
 </div>
	<script src="/admin/newTemplate/js/jquery-2.1.1.js"></script>
	<script src="/admin/newTemplate/js/bootstrap.min.js"></script>
	<script src="/admin/newTemplate/js/plugins/pace/pace.min.js"></script>
	<script src="/admin/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
	<script src="/admin/js/jquery.js"></script>
	<script>

	function btn(){
		   $.ajax({
				type:"get",
				data:$("#dataform").serialize(),
				url:"/Weixin/wetchPayUpdate",
				dataType : "json",
				async:false,
				success:function(data){
					var txt= data.msg;
	       			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.success,{onOk:function(){
							window.location.href="/Weixin/wetchPay";
	       			} });
				},
				error:function(data){
					//alert("失败");
					var txt=  "失败";
			        window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);
				}
			})
 }
 function creatMenu(){
	 $.ajax({
			type:"get",
			url:"/Weixin/creatMenu",
			dataType : "json",
			async:false,
			success:function(data){
				var txt= data.msg;
       			window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.success,{onOk:function(){
						window.location.href="/Weixin/wetchPay";
       			} });
			},error:function(data){
				var txt=  "失败";
		        window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.error);	
			}
	 });
 }
       		   
 
	</script>
</body>
</html>
